package com.example.demo.controller;

import com.example.demo.common.Result;
import com.example.demo.entity.Deliver;
import com.example.demo.service.DeliverService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * (Deliver)表控制层
 *
 * @author makejava
 * @since 2023-12-20 23:34:33
 */
@RestController
@RequestMapping("deliver")
public class DeliverController {
    /**
     * 服务对象
     */
    @Autowired
    private DeliverService deliverService;


    /**
     * 投递简历
     *
     * @param deliver 提供
     * @return {@code Result}
     */
    @PostMapping("resume")
    public Result resume(@RequestBody Deliver deliver){
        try {
            deliver.setId(null);
            deliverService.save(deliver);
            return Result.success("投递成功");
        } catch (Exception e){
            return Result.error("投递失败");
        }

    }

}

